<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/limh/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/limh/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/limh/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/limh/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/limh/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/limh/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/limh/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="自定义View,">










<meta name="description" content="前言 周末无事，看到抖音上罗盘时钟壁纸很炫酷，所以想着自己动手实践一下，顺便复习下自定义View的相关知识。  实现效果 上图为最终的效果，一个自定义View实现 实现过程首先确定View宽高，重新测量使画布宽高相等 12345678910111213141516@Override    protected void onMeasure(int widthMeasureSpec, int heig">
<meta name="keywords" content="自定义View">
<meta property="og:type" content="article">
<meta property="og:title" content="抖音网红罗盘时钟">
<meta property="og:url" content="https://tdnr.gitee.io/limh/2019/04/14/android01/index.html">
<meta property="og:site_name" content="土逗牛肉">
<meta property="og:description" content="前言 周末无事，看到抖音上罗盘时钟壁纸很炫酷，所以想着自己动手实践一下，顺便复习下自定义View的相关知识。  实现效果 上图为最终的效果，一个自定义View实现 实现过程首先确定View宽高，重新测量使画布宽高相等 12345678910111213141516@Override    protected void onMeasure(int widthMeasureSpec, int heig">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/10147880-b48dd31e0b2fd46e.gif?imageMogr2/auto-orient/strip">
<meta property="og:updated_time" content="2019-04-14T10:26:01.937Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="抖音网红罗盘时钟">
<meta name="twitter:description" content="前言 周末无事，看到抖音上罗盘时钟壁纸很炫酷，所以想着自己动手实践一下，顺便复习下自定义View的相关知识。  实现效果 上图为最终的效果，一个自定义View实现 实现过程首先确定View宽高，重新测量使画布宽高相等 12345678910111213141516@Override    protected void onMeasure(int widthMeasureSpec, int heig">
<meta name="twitter:image" content="https://upload-images.jianshu.io/upload_images/10147880-b48dd31e0b2fd46e.gif?imageMogr2/auto-orient/strip">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/limh/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://tdnr.gitee.io/limh/2019/04/14/android01/">





  <title>抖音网红罗盘时钟 | 土逗牛肉</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans ">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/limh/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">土逗牛肉</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/limh/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/limh/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/limh/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/limh/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/limh/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://tdnr.gitee.io/limh/limh/2019/04/14/android01/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="土逗牛肉">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/limh/images/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="土逗牛肉">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">抖音网红罗盘时钟</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2019-04-14T17:35:45+08:00">
                2019-04-14
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/limh/categories/Android/" itemprop="url" rel="index">
                    <span itemprop="name">Android</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><blockquote>
<p>周末无事，看到抖音上罗盘时钟壁纸很炫酷，所以想着自己动手实践一下，顺便复习下自定义View的相关知识。</p>
</blockquote>
<h2 id="实现效果"><a href="#实现效果" class="headerlink" title="实现效果"></a>实现效果</h2><p><img src="https://upload-images.jianshu.io/upload_images/10147880-b48dd31e0b2fd46e.gif?imageMogr2/auto-orient/strip" alt="GIF.gif"></p>
<p>上图为最终的效果，一个自定义View实现</p>
<h2 id="实现过程"><a href="#实现过程" class="headerlink" title="实现过程"></a>实现过程</h2><p>首先确定View宽高，重新测量使画布宽高相等</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">@Override</span><br><span class="line">    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) &#123;</span><br><span class="line">        super.onMeasure(widthMeasureSpec, heightMeasureSpec);</span><br><span class="line">        int widthSize = MeasureSpec.getSize(widthMeasureSpec);</span><br><span class="line">        int widthMode = MeasureSpec.getMode(widthMeasureSpec);</span><br><span class="line">        int heightSize = MeasureSpec.getSize(heightMeasureSpec);</span><br><span class="line">        int heightMode = MeasureSpec.getMode(heightMeasureSpec);</span><br><span class="line"></span><br><span class="line">        int width = Math.min(widthSize, heightSize);</span><br><span class="line">        if (widthMode == MeasureSpec.UNSPECIFIED) &#123;</span><br><span class="line">            width = heightSize + getPaddingRight() + getPaddingLeft();</span><br><span class="line">        &#125; else if (heightMode == MeasureSpec.UNSPECIFIED) &#123;</span><br><span class="line">            width = widthSize + getPaddingRight() + getPaddingLeft();</span><br><span class="line">        &#125;</span><br><span class="line">        setMeasuredDimension(width, width);</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
<p>为防止横屏出错，需要在尺寸改变的时候重新测量</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">@Override</span><br><span class="line">    protected void onSizeChanged(int w, int h, int oldw, int oldh) &#123;</span><br><span class="line">        width = w;</span><br><span class="line">        height = h;</span><br><span class="line">        if (width &gt; height) &#123;</span><br><span class="line">            radius = height / 2;</span><br><span class="line">        &#125; else &#123;</span><br><span class="line">            radius = width / 2;</span><br><span class="line">        &#125;</span><br><span class="line">        super.onSizeChanged(w, h, oldw, oldh);</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
<p>在资源文件中创建attrs.xml，方便通过布局配置样式：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">&lt;declare-styleable name=&quot;CompassView&quot;&gt;</span><br><span class="line">        &lt;!--中间姓氏--&gt;</span><br><span class="line">        &lt;attr name=&quot;centerText&quot; format=&quot;string&quot;/&gt;</span><br><span class="line">        &lt;!--中间文本大小--&gt;</span><br><span class="line">        &lt;attr name=&quot;centerSize&quot; format=&quot;dimension&quot;/&gt;</span><br><span class="line">        &lt;!--时钟字体大小--&gt;</span><br><span class="line">        &lt;attr name=&quot;clockTextSize&quot; format=&quot;dimension&quot;/&gt;</span><br><span class="line">        &lt;!--时钟字体颜色--&gt;</span><br><span class="line">        &lt;attr name=&quot;compassColor&quot; format=&quot;color&quot;/&gt;</span><br><span class="line">        &lt;!--当前时间颜色--&gt;</span><br><span class="line">        &lt;attr name=&quot;selectColor&quot; format=&quot;color&quot;/&gt;</span><br><span class="line">    &lt;/declare-styleable&gt;</span><br></pre></td></tr></table></figure>
<p>整个View分四部分：</p>
<ul>
<li>中间姓氏</li>
<li>12小时制时</li>
<li>分钟</li>
<li>秒钟</li>
</ul>
<h4 id="中间姓氏代码实现"><a href="#中间姓氏代码实现" class="headerlink" title="中间姓氏代码实现"></a>中间姓氏代码实现</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line">/**</span><br><span class="line"> * 初始化</span><br><span class="line"> *</span><br><span class="line"> * @param context 上下文对象</span><br><span class="line"> * @param attrs   资源</span><br><span class="line"> */</span><br><span class="line">private void init(Context context, @Nullable AttributeSet attrs) &#123;</span><br><span class="line">    if (null != attrs) &#123;</span><br><span class="line">        TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CompassView);</span><br><span class="line">        centerText = array.getString(R.styleable.CompassView_centerText);</span><br><span class="line">        centerSize = array.getDimension(R.styleable.CompassView_centerSize, 18);</span><br><span class="line">        clockTextSize = array.getDimension(R.styleable.CompassView_clockTextSize, 14);</span><br><span class="line">        compassColor = array.getColor(R.styleable.CompassView_compassColor, ContextCompat.getColor(context, R.color.colorGray));</span><br><span class="line">        selectColor = array.getColor(R.styleable.CompassView_selectColor, ContextCompat.getColor(context, R.color.colorWhite));</span><br><span class="line">        array.recycle();</span><br><span class="line">    &#125;</span><br><span class="line">    //初始化姓氏画笔</span><br><span class="line">    bounds = new Rect();</span><br><span class="line">    clockBounds = new Rect();</span><br><span class="line">    txtPaint = new Paint();</span><br><span class="line">    txtPaint.setColor(selectColor);</span><br><span class="line">    txtPaint.setTextAlign(Paint.Align.CENTER);</span><br><span class="line">    txtPaint.setTextSize(centerSize);</span><br><span class="line">    ，，，，</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">@Override</span><br><span class="line">protected void onDraw(Canvas canvas) &#123;</span><br><span class="line">    super.onDraw(canvas);</span><br><span class="line">    ，，，，</span><br><span class="line">    //测量文本</span><br><span class="line">    txtPaint.getTextBounds(centerText, 0, centerText.length(), bounds);</span><br><span class="line">    //画姓氏</span><br><span class="line">    canvas.drawText(centerText, radius, radius - (float) (bounds.top + bounds.bottom) / 2, txtPaint);</span><br><span class="line">    ，，，，</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h4 id="画时分秒罗盘"><a href="#画时分秒罗盘" class="headerlink" title="画时分秒罗盘"></a>画时分秒罗盘</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br></pre></td><td class="code"><pre><span class="line">//画小时刻度</span><br><span class="line">for (int i = 0; i &lt; shis.length; i++) &#123;</span><br><span class="line">    double degree = (i + 12 - hour + 4) * rr2;</span><br><span class="line">    float x = (float) (radius + centerSize * Math.sin(degree));</span><br><span class="line">    float y = (float) (radius - centerSize * Math.cos(degree));</span><br><span class="line">    canvas.save();</span><br><span class="line">    canvas.rotate((float) (degree / Math.PI * 180 - 90), x, y);</span><br><span class="line">    sPaint.getTextBounds(shis[i], 0, shis[i].length(), clockBounds);</span><br><span class="line">    if (i == hour - 1) &#123;</span><br><span class="line">        sPaint.setColor(selectColor);</span><br><span class="line">    &#125; else &#123;</span><br><span class="line">        sPaint.setColor(compassColor);</span><br><span class="line">    &#125;</span><br><span class="line">    canvas.drawText(shis[i], x, y - (float) (clockBounds.top + clockBounds.bottom) / 2, sPaint);</span><br><span class="line">    canvas.restore();</span><br><span class="line">&#125;</span><br><span class="line">//画分</span><br><span class="line">for (int i = 0; i &lt; fenmiaos.length; i++) &#123;</span><br><span class="line">    double degree = (i + 60 - minute + 15) * rr;</span><br><span class="line">    float x = (float) (radius + (radius / 2 - clockTextSize) * Math.sin(degree));</span><br><span class="line">    float y = (float) (radius - (radius / 2 - clockTextSize) * Math.cos(degree));</span><br><span class="line">    canvas.save();</span><br><span class="line">    canvas.rotate((float) (degree / Math.PI * 180 - 90), x, y);</span><br><span class="line">    fPaint.getTextBounds(fenmiaos[i] + &quot;分&quot;, 0, (fenmiaos[i] + &quot;分&quot;).length(), clockBounds);</span><br><span class="line">    if (i == minute) &#123;</span><br><span class="line">        fPaint.setColor(selectColor);</span><br><span class="line">    &#125; else &#123;</span><br><span class="line">        fPaint.setColor(compassColor);</span><br><span class="line">    &#125;</span><br><span class="line">    canvas.drawText(fenmiaos[i] + &quot;分&quot;, x, y - (float) (clockBounds.top + clockBounds.bottom) / 2, fPaint);</span><br><span class="line">    canvas.restore();</span><br><span class="line">&#125;</span><br><span class="line">//画秒</span><br><span class="line">for (int i = 0; i &lt; fenmiaos.length; i++) &#123;</span><br><span class="line">    double degree = (i + 60 - second + 15) * rr;</span><br><span class="line">    float x = (float) (radius + (radius - clockTextSize * 4) * Math.sin(degree));</span><br><span class="line">    float y = (float) (radius - (radius - clockTextSize * 4) * Math.cos(degree));</span><br><span class="line">    canvas.save();</span><br><span class="line">    canvas.rotate((float) (degree / Math.PI * 180 - 90), x, y);</span><br><span class="line">    mPaint.getTextBounds(fenmiaos[i] + &quot;秒&quot;, 0, (fenmiaos[i] + &quot;秒&quot;).length(), clockBounds);</span><br><span class="line">    if (i == second) &#123;</span><br><span class="line">        mPaint.setColor(selectColor);</span><br><span class="line">    &#125; else &#123;</span><br><span class="line">        mPaint.setColor(compassColor);</span><br><span class="line">    &#125;</span><br><span class="line">    canvas.drawText(fenmiaos[i] + &quot;秒&quot;, x, y - (float) (clockBounds.top + clockBounds.bottom) / 2, mPaint);</span><br><span class="line">    canvas.restore();</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h4 id="完整代码"><a href="#完整代码" class="headerlink" title="完整代码"></a>完整代码</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br></pre></td><td class="code"><pre><span class="line">/**</span><br><span class="line"> * @author limh</span><br><span class="line"> * @function</span><br><span class="line"> * @date 2019/4/14 9:51</span><br><span class="line"> */</span><br><span class="line">public class CompassView extends View &#123;</span><br><span class="line">    private String TAG = &quot;CompassView&quot;;</span><br><span class="line">    private String[] shis = &#123;&quot;一点&quot;, &quot;两点&quot;, &quot;三点&quot;, &quot;四点&quot;, &quot;五点&quot;, &quot;六点&quot;, &quot;七点&quot;, &quot;八点&quot;, &quot;九点&quot;, &quot;十点&quot;, &quot;十一点&quot;, &quot;十二点&quot;&#125;;</span><br><span class="line">    private String[] fenmiaos = &#123;&quot;零&quot;, &quot;一&quot;, &quot;二&quot;, &quot;三&quot;, &quot;四&quot;, &quot;五&quot;, &quot;六&quot;, &quot;七&quot;, &quot;八&quot;, &quot;九&quot;, &quot;十&quot;,</span><br><span class="line">            &quot;十一&quot;, &quot;十二&quot;, &quot;十三&quot;, &quot;十四&quot;, &quot;十五&quot;, &quot;十六&quot;, &quot;十七&quot;, &quot;十八&quot;, &quot;十九&quot;, &quot;二十&quot;,</span><br><span class="line">            &quot;二十一&quot;, &quot;二十二&quot;, &quot;二十三&quot;, &quot;二十四&quot;, &quot;二十五&quot;, &quot;二十六&quot;, &quot;二十七&quot;, &quot;二十八&quot;, &quot;二十九&quot;, &quot;三十&quot;,</span><br><span class="line">            &quot;三十一&quot;, &quot;三十二&quot;, &quot;三十三&quot;, &quot;三十四&quot;, &quot;三十五&quot;, &quot;三十六&quot;, &quot;三十七&quot;, &quot;三十八&quot;, &quot;三十九&quot;, &quot;四十&quot;,</span><br><span class="line">            &quot;四十一&quot;, &quot;四十二&quot;, &quot;四十三&quot;, &quot;四十四&quot;, &quot;四十五&quot;, &quot;四十六&quot;, &quot;四十七&quot;, &quot;四十八&quot;, &quot;四十九&quot;, &quot;五十&quot;,</span><br><span class="line">            &quot;五十一&quot;, &quot;五十二&quot;, &quot;五十三&quot;, &quot;五十四&quot;, &quot;五十五&quot;, &quot;五十六&quot;, &quot;五十七&quot;, &quot;五十八&quot;, &quot;五十九&quot;&#125;;</span><br><span class="line">    private Double rr = 2 * Math.PI / 60;//2π即360度的圆形f份成60份,一秒钟与一钟</span><br><span class="line">    private Double rr2 = 2 * Math.PI / 12;//2π圆形份成12份,圆形显示12个小时的刻度</span><br><span class="line">    //半径</span><br><span class="line">    private int radius;</span><br><span class="line">    //宽</span><br><span class="line">    private int width;</span><br><span class="line">    //高</span><br><span class="line">    private int height;</span><br><span class="line"></span><br><span class="line">    //画笔 时  分 秒</span><br><span class="line">    private Paint sPaint;</span><br><span class="line">    private Paint fPaint;</span><br><span class="line">    private Paint mPaint;</span><br><span class="line">    //中间文字</span><br><span class="line">    private Paint txtPaint;</span><br><span class="line">    private Rect bounds;</span><br><span class="line">    private Rect clockBounds;</span><br><span class="line"></span><br><span class="line">    private String centerText = &quot;李&quot;;</span><br><span class="line">    private float centerSize = 18f;</span><br><span class="line">    private float clockTextSize = 14f;</span><br><span class="line">    private int compassColor = 0xFFDDDDDD;</span><br><span class="line">    private int selectColor = 0xFF000000;</span><br><span class="line"></span><br><span class="line">    private int hour = 1;</span><br><span class="line">    private int minute = 0;</span><br><span class="line">    private int second = 0;</span><br><span class="line"></span><br><span class="line">    public CompassView(Context context) &#123;</span><br><span class="line">        super(context);</span><br><span class="line">        init(context, null);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public CompassView(Context context, @Nullable AttributeSet attrs) &#123;</span><br><span class="line">        super(context, attrs);</span><br><span class="line">        init(context, attrs);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public CompassView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) &#123;</span><br><span class="line">        super(context, attrs, defStyleAttr);</span><br><span class="line">        init(context, attrs);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    /**</span><br><span class="line">     * 初始化</span><br><span class="line">     *</span><br><span class="line">     * @param context 上下文对象</span><br><span class="line">     * @param attrs   资源</span><br><span class="line">     */</span><br><span class="line">    private void init(Context context, @Nullable AttributeSet attrs) &#123;</span><br><span class="line">        if (null != attrs) &#123;</span><br><span class="line">            TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CompassView);</span><br><span class="line">            centerText = array.getString(R.styleable.CompassView_centerText);</span><br><span class="line">            centerSize = array.getDimension(R.styleable.CompassView_centerSize, 18);</span><br><span class="line">            clockTextSize = array.getDimension(R.styleable.CompassView_clockTextSize, 14);</span><br><span class="line">            compassColor = array.getColor(R.styleable.CompassView_compassColor, ContextCompat.getColor(context, R.color.colorGray));</span><br><span class="line">            selectColor = array.getColor(R.styleable.CompassView_selectColor, ContextCompat.getColor(context, R.color.colorWhite));</span><br><span class="line">            array.recycle();</span><br><span class="line">        &#125;</span><br><span class="line">        bounds = new Rect();</span><br><span class="line">        clockBounds = new Rect();</span><br><span class="line">        txtPaint = new Paint();</span><br><span class="line">        txtPaint.setColor(selectColor);</span><br><span class="line">        txtPaint.setTextAlign(Paint.Align.CENTER);</span><br><span class="line">        txtPaint.setTextSize(centerSize);</span><br><span class="line"></span><br><span class="line">        sPaint = new Paint();</span><br><span class="line">        sPaint.setColor(compassColor);</span><br><span class="line">        sPaint.setTextAlign(Paint.Align.CENTER);</span><br><span class="line">        sPaint.setTextSize(clockTextSize);</span><br><span class="line"></span><br><span class="line">        fPaint = new Paint();</span><br><span class="line">        fPaint.setColor(compassColor);</span><br><span class="line">        fPaint.setTextAlign(Paint.Align.LEFT);</span><br><span class="line">        fPaint.setTextSize(clockTextSize);</span><br><span class="line"></span><br><span class="line">        mPaint = new Paint();</span><br><span class="line">        mPaint.setColor(compassColor);</span><br><span class="line">        mPaint.setTextAlign(Paint.Align.LEFT);</span><br><span class="line">        mPaint.setTextSize(clockTextSize);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    @Override</span><br><span class="line">    protected void onDraw(Canvas canvas) &#123;</span><br><span class="line">        super.onDraw(canvas);</span><br><span class="line">        updateTime();</span><br><span class="line">        //测量文本</span><br><span class="line">        txtPaint.getTextBounds(centerText, 0, centerText.length(), bounds);</span><br><span class="line">        //画姓氏</span><br><span class="line">        canvas.drawText(centerText, radius, radius - (float) (bounds.top + bounds.bottom) / 2, txtPaint);</span><br><span class="line">        //画小时刻度</span><br><span class="line">        for (int i = 0; i &lt; shis.length; i++) &#123;</span><br><span class="line">            double degree = (i + 12 - hour + 4) * rr2;</span><br><span class="line">            float x = (float) (radius + centerSize * Math.sin(degree));</span><br><span class="line">            float y = (float) (radius - centerSize * Math.cos(degree));</span><br><span class="line">            canvas.save();</span><br><span class="line">            canvas.rotate((float) (degree / Math.PI * 180 - 90), x, y);</span><br><span class="line">            sPaint.getTextBounds(shis[i], 0, shis[i].length(), clockBounds);</span><br><span class="line">            if (i == hour - 1) &#123;</span><br><span class="line">                sPaint.setColor(selectColor);</span><br><span class="line">            &#125; else &#123;</span><br><span class="line">                sPaint.setColor(compassColor);</span><br><span class="line">            &#125;</span><br><span class="line">            canvas.drawText(shis[i], x, y - (float) (clockBounds.top + clockBounds.bottom) / 2, sPaint);</span><br><span class="line">            canvas.restore();</span><br><span class="line">        &#125;</span><br><span class="line">        //画分</span><br><span class="line">        for (int i = 0; i &lt; fenmiaos.length; i++) &#123;</span><br><span class="line">            double degree = (i + 60 - minute + 15) * rr;</span><br><span class="line">            float x = (float) (radius + (radius / 2 - clockTextSize) * Math.sin(degree));</span><br><span class="line">            float y = (float) (radius - (radius / 2 - clockTextSize) * Math.cos(degree));</span><br><span class="line">            canvas.save();</span><br><span class="line">            canvas.rotate((float) (degree / Math.PI * 180 - 90), x, y);</span><br><span class="line">            fPaint.getTextBounds(fenmiaos[i] + &quot;分&quot;, 0, (fenmiaos[i] + &quot;分&quot;).length(), clockBounds);</span><br><span class="line">            if (i == minute) &#123;</span><br><span class="line">                fPaint.setColor(selectColor);</span><br><span class="line">            &#125; else &#123;</span><br><span class="line">                fPaint.setColor(compassColor);</span><br><span class="line">            &#125;</span><br><span class="line">            canvas.drawText(fenmiaos[i] + &quot;分&quot;, x, y - (float) (clockBounds.top + clockBounds.bottom) / 2, fPaint);</span><br><span class="line">            canvas.restore();</span><br><span class="line">        &#125;</span><br><span class="line">        //画秒</span><br><span class="line">        for (int i = 0; i &lt; fenmiaos.length; i++) &#123;</span><br><span class="line">            double degree = (i + 60 - second + 15) * rr;</span><br><span class="line">            float x = (float) (radius + (radius - clockTextSize * 4) * Math.sin(degree));</span><br><span class="line">            float y = (float) (radius - (radius - clockTextSize * 4) * Math.cos(degree));</span><br><span class="line">            canvas.save();</span><br><span class="line">            canvas.rotate((float) (degree / Math.PI * 180 - 90), x, y);</span><br><span class="line">            mPaint.getTextBounds(fenmiaos[i] + &quot;秒&quot;, 0, (fenmiaos[i] + &quot;秒&quot;).length(), clockBounds);</span><br><span class="line">            if (i == second) &#123;</span><br><span class="line">                mPaint.setColor(selectColor);</span><br><span class="line">            &#125; else &#123;</span><br><span class="line">                mPaint.setColor(compassColor);</span><br><span class="line">            &#125;</span><br><span class="line">            canvas.drawText(fenmiaos[i] + &quot;秒&quot;, x, y - (float) (clockBounds.top + clockBounds.bottom) / 2, mPaint);</span><br><span class="line">            canvas.restore();</span><br><span class="line">        &#125;</span><br><span class="line">        //每秒刷新</span><br><span class="line">        postInvalidateDelayed(1000);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    /**</span><br><span class="line">     * 更新当前时间</span><br><span class="line">     */</span><br><span class="line">    private void updateTime() &#123;</span><br><span class="line">        Calendar calendar = Calendar.getInstance();</span><br><span class="line">        hour = calendar.get(Calendar.HOUR);//获取小时,12小时制</span><br><span class="line">        minute = calendar.get(Calendar.MINUTE);//获取分钟</span><br><span class="line">        second = calendar.get(Calendar.SECOND);//获取秒</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    @Override</span><br><span class="line">    protected void onSizeChanged(int w, int h, int oldw, int oldh) &#123;</span><br><span class="line">        width = w;</span><br><span class="line">        height = h;</span><br><span class="line">        if (width &gt; height) &#123;</span><br><span class="line">            radius = height / 2;</span><br><span class="line">        &#125; else &#123;</span><br><span class="line">            radius = width / 2;</span><br><span class="line">        &#125;</span><br><span class="line">        super.onSizeChanged(w, h, oldw, oldh);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    @Override</span><br><span class="line">    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) &#123;</span><br><span class="line">        super.onMeasure(widthMeasureSpec, heightMeasureSpec);</span><br><span class="line">        int widthSize = MeasureSpec.getSize(widthMeasureSpec);</span><br><span class="line">        int widthMode = MeasureSpec.getMode(widthMeasureSpec);</span><br><span class="line">        int heightSize = MeasureSpec.getSize(heightMeasureSpec);</span><br><span class="line">        int heightMode = MeasureSpec.getMode(heightMeasureSpec);</span><br><span class="line"></span><br><span class="line">        int width = Math.min(widthSize, heightSize);</span><br><span class="line">        if (widthMode == MeasureSpec.UNSPECIFIED) &#123;</span><br><span class="line">            width = heightSize + getPaddingRight() + getPaddingLeft();</span><br><span class="line">        &#125; else if (heightMode == MeasureSpec.UNSPECIFIED) &#123;</span><br><span class="line">            width = widthSize + getPaddingRight() + getPaddingLeft();</span><br><span class="line">        &#125;</span><br><span class="line">        setMeasuredDimension(width, width);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/limh/tags/自定义View/" rel="tag"># 自定义View</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/limh/2019/03/16/android02/" rel="next" title="获取设备唯一ID（基本能保持不变不重复）">
                <i class="fa fa-chevron-left"></i> 获取设备唯一ID（基本能保持不变不重复）
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/limh/2019/04/20/android03/" rel="prev" title="Android原生拍照及相册选取图片">
                Android原生拍照及相册选取图片 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="SOHUCS"></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/limh/images/avatar.jpg" alt="土逗牛肉">
            
              <p class="site-author-name" itemprop="name">土逗牛肉</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/limh/archives/">
              
                  <span class="site-state-item-count">255</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/limh/categories/index.html">
                  <span class="site-state-item-count">8</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/limh/tags/index.html">
                  <span class="site-state-item-count">7</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/limhGeek" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:1591054297@qq.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.jianshu.com/u/f73b243e7cc9" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-user-circle-o"></i>简书</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#前言"><span class="nav-number">1.</span> <span class="nav-text">前言</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#实现效果"><span class="nav-number">2.</span> <span class="nav-text">实现效果</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#实现过程"><span class="nav-number">3.</span> <span class="nav-text">实现过程</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#中间姓氏代码实现"><span class="nav-number">3.0.1.</span> <span class="nav-text">中间姓氏代码实现</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#画时分秒罗盘"><span class="nav-number">3.0.2.</span> <span class="nav-text">画时分秒罗盘</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#完整代码"><span class="nav-number">3.0.3.</span> <span class="nav-text">完整代码</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">土逗牛肉</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
	var str = GetUrlParam('height');
    if (str === '0'){
		document.getElementById('header').style.display = 'none';
		document.getElementById('comments').style.display = 'none';
		document.getElementById('footer').style.display = 'none';
		document.getElementsByClassName('post-footer').item(0).style.display = 'none'
	}
	
    function GetUrlParam(paraName) {
        var url = document.location.toString();
        var arrObj = url.split("?");

        if (arrObj.length > 1) {
            var arrPara = arrObj[1].split("&");
            var arr;

            for (var i = 0; i < arrPara.length; i++) {
                 arr = arrPara[i].split("=");

                if (arr != null && arr[0] === paraName) {
                    return arr[1];
                }
            }
            return "";
        } else {
            return "";
        }
    }
</script>









  












  
  
    <script type="text/javascript" src="/limh/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/limh/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/limh/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/limh/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/limh/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/limh/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/limh/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/limh/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
